
import {layer} from 'nuijs';
import './style/companylayer.less';
export  function companylayer(e,elem,data) {
    //查询的弹出层；
    // 使用popover的组件
    //表单的reset
    this.self.request('post','certificate/getUserDetail.do',{'id':elem.closest('tr').data('id')},function(res){
        layer({
            width:700,
            data:res,
            title:'查看详情',
            skin:'company',
            cancel:false,
            template:`
            <div class="m-item">
                <input type="hidden" id="layerid" value="<%id%>">
                <h3><i></i>开发者信息</h3>
                <table>
                    <tbody>
                        <tr>
                            <td class="td-lable">公司名称</td>
                            <td colspan="3" class="m-enterpriseName"><%enterpriseName%></td>
                        </tr>
                        <tr>
                            <td class="td-lable">登录账号</td>
                            <td class="td-cont"><%businessTax%></td>
                            <td class="td-lable">联系人</td>
                            <td><%contactName%></td>
                        </tr>
                        <tr>
                            <td class="td-lable">联系邮箱</td>
                            <td class="td-cont"><%mail%></td>
                            <td class="td-lable">联系电话</td>
                            <td><%phone%></td>
                        </tr>
                    </tbody>
                </table>
                <table>
                    <tbody>
                        <tr>
                            <td class="td-lable licence">公司营业执照号</td>
                            <td><%licenseNo%></td>
                        </tr>
                        <tr>
                            <td class="td-lable licence">使用场景</td>
                            <td><%sceneDesc%></td>
                            
                        </tr>
                        <tr>
                            <td class="td-lable licence licenceImg">企业营业执照图片</td>
                            <td>
                                <div class="licenceImg">
                                    <img class="imgLay" src="<%licenseId%>"></img>
                                    <i class="iconfont j-imgpreview">&#xe66c;</i>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="m-item e-mt30 f-tac">
                <!-- 0：已认证，1：认证失败，2：待认证 -->
                <%if state=='2'%>
                <a class="ui-btn ui-m-btn ui-btn-fill e-mr10 j-check" data-type="1">审核</a>
                <%/if%>
                <a class="ui-btn ui-m-btn ui-btn-hollow">返回</a>
            </div>
            `,
            events:{
                'click .ui-btn-hollow':function(){
                    this.self.hide();
                },
                'click .j-imgpreview':function(){
                    var src=$('.m-item .j-imgpreview').siblings('img').attr('src');
                    layer({
                        template:`<img src="<%src%>">`,
                        data:{'src':src},
                        skin:'img',
                        width:700,
                        height:700,
                        cancel:false,
                        title:{
                            enable:false
                        }
                    });
                    this.self.hide();
                }
            }
        })
    })
   
}